// ES6 无块级作用域 无变量提升

const out_1 = 'out_1'
const out_2 = 'out_2'

const outFnOne = (out) => {
  return out_1  
}

const outFnTwo = (out) => {
  const out_2 = 'in_2'
  return out_2
}

console.log(outFnOne())
console.log(outFnTwo())

const fn = (flag) => {
  if(flag) {
    function getChat() { return 'A' }  
  } else {
    function getChat() { return 'B' }  
  }

  return getChat()
}

console.log(fn(true))
console.log(fn(false))
